﻿
@{
    ViewData["Title"] = "微信推送消息列表";
    var list = ViewData["list"] as List<wechat_openid>;
    var page = ViewData["page"] as PageModel;
}

<div class="row">
    <div class="col-md-12">

        <table class="@ViewHelper.Standard_table_css">
            <thead>
                <tr>
                    <th data-column-name="@nameof(wechat_openid.openid)">微信用户ID</th>
                    <th data-column-name="@nameof(wechat_openid.status)">状态</th>
                    <th data-column-name="@nameof(wechat_openid.ut_message)">未处理的消息数量</th>
                    <th data-column-name="@nameof(wechat_openid.create_time)">创建时间</th>
                    <th data-column-name="@nameof(wechat_openid.last_update)">更新时间</th>
                </tr>
            </thead>
            <tbody>
                @{
                    if (list.Count > 0)
                    {
                        foreach (var item in list)
                        {
                            var href = Url.Action("detail", new { id = item.openid });
                            <tr data-id="@item.openid">
                                <td><a href="@href">@item.openid</a></td>
                                <td>@(item.status ? "关注" : "取关")</td>
                                <td>@item.ut_message</td>
                                <td>@item.create_time.ToLocalDateTimeString()</td>
                                <td>@item.last_update.ToLocalDateTimeString()</td>
                            </tr>
                        }
                    }
                    else
                    {
                        @Html.Raw(ViewHelper.Standard_no_record_tr)
                    }
                }
            </tbody>
        </table>
        @Html.Partial("Pagination", page)
    </div>
</div>